package com.lagou.pojo;

import com.lagou.enums.SqlCommandType;

import java.util.Locale;

public class MappedStatement {

    /**
     * id标识
     */
    private String id;
    /**
     * 空间名
     */
    private String namespace;
    /**
     * 原sql语句
     */
    private String sql;
    /**
     * sql类型
     */
    private SqlCommandType sqlCommandType;
    /**
     * 参数类型
     */
    private Class<?> paramterType;
    /**
     * 结果类型
     */
    private Class<?> resultType;
    /**
     * 是否刷新二级缓存 默认不刷新
     */
    private Boolean useCache = false;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public SqlCommandType getSqlCommandType() {
        return sqlCommandType;
    }

    public void setSqlCommandType(String sqlCommandType) {
        this.sqlCommandType = SqlCommandType.valueOf(sqlCommandType.toUpperCase((Locale.ENGLISH)));
    }

    public Class<?> getParamterType() {
        return paramterType;
    }

    public void setParamterType(Class<?> paramterType) {
        this.paramterType = paramterType;
    }

    public Class<?> getResultType() {
        return resultType;
    }

    public void setResultType(Class<?> resultType) {
        this.resultType = resultType;
    }

    public Boolean getUseCache() {
        return useCache;
    }

    public void setUseCache(Boolean useCache) {
        this.useCache = useCache;
    }
}
